package com.zyh.alpacaSse.config;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.time.Duration;

/**
 * @Classname AlpacaSseProperties
 * @Description TODO()
 * @Date 2025-09-03 22:48
 * @Created by 86177
 */
@Data
@ConfigurationProperties(prefix = "alpaca.sse")
public class AlpacaSseProperties {
    private String url;
    private String apiKey;
    private String apiSecret;
    private ReconnectProperties reconnect = new ReconnectProperties();
    private DedupeProperties dedupe = new DedupeProperties();

    @Data
    public static class ReconnectProperties {
        private long initialDelay = 1000;
        private long maxDelay = 60000;
        private int maxAttempts = 50;
    }

    @Data
    public static class DedupeProperties {
        private int cacheSize = 1000;
        private Duration cacheTtl = Duration.ofHours(1);
    }
}
